<?php
/*
Plugin Name: 游客切换模板
Version: 1.2
Plugin URL:
Description: 游客切换模板，自动历遍模板目录
ForEmlog:4.2.1
Author: 宇&石头
Author URL: http://bbandyy.com
*/

!defined('EMLOG_ROOT') && exit('access deined!');

function choise_theme()
{
$theme_choise_dir=EMLOG_ROOT . '/content/templates';
$theme_choise_dp=opendir($theme_choise_dir);
echo '<form name="theme" method="GET" action=""><b>主题选择：</b><select name="demo">';
while ($theme_choise_file = readdir($theme_choise_dp))
{
if ($theme_choise_file !='.'&&$theme_choise_file !='..')
{
$theme_choise_path=$theme_choise_dir."/".$theme_choise_file;
if(is_dir($theme_choise_path))
{
echo '<option value="'.$theme_choise_file.'">'.$theme_choise_file;
}
}
}
echo '</select><input type="submit" value="选择">';
closedir($theme_choise_dp);
}
addAction('index_loglist_top', 'choise_theme');
